    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// demo接口1
export const demo1 = (data:any) => {
    return service({
        url: '/user/user/demo1/' + data,
        method: 'post'
    })
};


// demo接口2
export const demo2 = (data:any) => {
    return service({
        url: '/user/user/demo2',
        method: 'post',
        data
    })
};

// 登录
export const adminLogin = (data:any) => {
    return service({
        url: '/user/index/adminLogin',
        method: 'post',
        data
    })
};

// 根据用户ID获取权限
export const getMenuTree = () => {
    return service({
        url: '/user/index/getMenuTree/',
        method: 'post'
    })
};

// 获取商家分页列表
export const getUserList = (data:any) => {
    return service({
        url: '/user/index/getUserList',
        method: 'post',
        data
    })
};

// 获取品牌分页列表
export const getBrandList = (data:any) => {
    return service({
        url: '/shop/index/getBrandList',
        method: 'post',
        data
    })
};

// 添加品牌
export const addBrand = (data:any) => {
    return service({
        url: '/shop/index/addBrand',
        method: 'post',
        data
    })
};

// 修改品牌状态
export const changeBrandStatus = (data:any) => {
    return service({
        url: '/shop/index/changeBrandStatus',
        method: 'post',
        data
    })
};

// 根据品牌ID删除品牌
export const deleteByBrandId = (brandId:any) => {
    return service({
        url: '/shop/index/deleteByBrandId/' + brandId,
        method: 'post'
    })
};

// 批量删除品牌
export const deleteBatchBrand = (data:any) => {
    return service({
        url: '/shop/index/deleteBatchBrand',
        method: 'post',
        data
    })
};

// 获取商品分类分页列表
export const getTreeList = () => {
    return service({
        url: '/shop/type/getTreeList',
        method: 'post'
    })
};

// 添加分类
export const addType = (data:any) => {
    return service({
        url: '/shop/type/addType',
        method: 'post',
        data
    })
};

// 分页获取商品列表
export const getProdList = (data:any) => {
    return service({
        url: '/shop/prod/getProdList',
        method: 'post',
        data
    })
};

// 获取字典列表数据
export const getDietList = (typeId:any) => {
    return service({
        url: '/shop/dict/getDietList/' + typeId,
        method: 'post'
    })
};

// 获取商品分类树形数据
export const getSelectTree = () => {
    return service({
        url: '/shop/type/getSelectTree',
        method: 'post'
    })
};

// 添加商品
export const addProd = (data:any) => {
    return service({
        url: '/shop/prod/addProd',
        method: 'post',
        data
    })
};

// 添加商品附件
export const addProdAtta = (data:any) => {
    return service({
        url: '/shop/prod/addProdAtta',
        method: 'post',
        data
    })
};

// 批量删除商品
export const deleteBatchProd = (data:any) => {
    return service({
        url: '/shop/prod/deleteBatchProd',
        method: 'post',
        data
    })
};

// 单个删除商品
export const deleteProd = (id:any) => {
    return service({
        url: '/shop/prod/deleteProd/' + id,
        method: 'post'
    })
};

// 订单分页列表
export const getOrderList = (data:any) => {
    return service({
        url: '/shop/order/getOrderList',
        method: 'post',
        data
    })
};

// 获取商品信息列表
export const getProdInfoList = () => {
    return service({
        url: '/shop/prod/getProdInfoList',
        method: 'post'
    })
};

// 添加订单
export const addOrder = (data:any) => {
    return service({
        url: '/shop/order/addOrder',
        method: 'post',
        data
    })
};

// 批量删除订单
export const deleteBatchOrder = (data:any) => {
    return service({
        url: '/shop/order/deleteBatchOrder',
        method: 'post',
        data
    })
};

// 从Es获取商品
export const getProdFromEs = (data:any) => {
    return service({
        url: '/shop/prod/getProdFromEs',
        method: 'post',
        data
    })
};

// 获取用户信息
export const getUserInfo = () => {
    return service({
        url: '/user/index/getUserInfo',
        method: 'post'
    })
};

// 根据Id，获取订单信息
export const getOrderInfoById = (orderId:any) => {
    return service({
        url: '/shop/order/getOrderInfoById/' + orderId,
        method: 'post'
    })
};

// 获取活动分页列表
export const getActiveList = (data:any) => {
    return service({
        url: '/win/index/getActiveList',
        method: 'post',
        data
    })
};

// 添加抽奖活动
export const addActive = (data:any) => {
    return service({
        url: '/win/index/addActive',
        method: 'post',
        data
    })
};

// 用户免费参加抽奖活动
export const joinActive = (activeId:any) => {
    return service({
        url: '/win/index/joinActive/' + activeId,
        method: 'post'
    })
};

// 用户积分参加抽奖活动
export const joinActiveByScore = (activeId:any) => {
    return service({
        url: '/win/index/joinActiveByScore/' + activeId,
        method: 'post'
    })
};

// 抽奖记录分页列表
export const getJoinRecord = (data:any) => {
    return service({
        url: '/win/index/getJoinRecord',
        method: 'post',
        data
    })
};

// 用户签到
export const signIn = () => {
    return service({
        url: '/user/index/signIn',
        method: 'post'
    })
};

// 根据活动ID获取活动信息
export const getActiveById = (activeId:any) => {
    return service({
        url: '/win/index/getActiveById/' + activeId,
        method: 'post'
    })
};

// 获取优惠券分页列表
export const getCouponList = (data:any) => {
    return service({
        url: '/win/coupon/getCouponList',
        method: 'post',
        data
    })
};

// 添加优惠券
export const addCoupon = (data:any) => {
    return service({
        url: '/win/coupon/addCoupon',
        method: 'post',
        data
    })
};

// 根据优惠券ID领取
export const claimCoupon = (couponId:any) => {
    return service({
        url: '/win/coupon/claimCoupon/' + couponId,
        method: 'post'
    })
};

// 从Es获取领取记录分页列表
export const getCouponRecordList = (data:any) => {
    return service({
        url: '/win/coupon/getCouponRecordList',
        method: 'post',
        data
    })
};